Conflicts:
This commit is contained in:
2024-09-19 15:13:11 +08:00
11 changed files with 121 additions and 12 deletions

View File

@@ -485,7 +485,7 @@
/// <summary>
/// 默认传给erp的用户id
/// </summary>
public const string ERPUSERID = "1001A110000000003NBJ";
public const string ERPUSERID = "1001A1100000002QG0WU";
/// <summary>
/// ERPId(天益4厂)
/// </summary>

View File

@@ -5,7 +5,7 @@ using SqlSugar;
namespace Tnb.WarehouseMgr.Entities.Entity;
/// <summary>
/// 委外订单表子表
/// 委外收货表子表
/// </summary>
[SugarTable("wms_outsource_d")]
public partial class WmsOutsourceD : BaseEntity<string>

View File

@@ -3158,13 +3158,13 @@ namespace Tnb.WarehouseMgr
work_station = ""
}).Where(r => r.id == dt.carry_id).ExecuteCommandAsync();
await QTRK2BIP(dt, db);
//await QTRK2BIP(dt, db);
// require_code是任务单
//string mo_task_code = dt.require_code;
}
else if (dt.biz_type == "erp_qtrk")
{
await QTRK2BIP(dt, db);
//await QTRK2BIP(dt, db);
}
#endregion

View File

@@ -28,6 +28,7 @@ using Tnb.WarehouseMgr.Interfaces;
using Tnb.ProductionMgr.Entities.Entity;
using Tnb.BasicData;
using Tnb.WarehouseMgr.Entities.Entity;
using Microsoft.Extensions.Logging;
namespace Tnb.WarehouseMgr
{
@@ -297,11 +298,13 @@ namespace Tnb.WarehouseMgr
// 采购入库
if (instock.bill_type == WmsWareHouseConst.BILLTYPE_MATERIALINSTOCK_ID)
{
//await _db.Updateable<WmsCarryCode>().SetColumns(r => new WmsCarryCode
//{
// auxprop_gys = ,
// auxprop_xph =
//}).Where(r => r.id == input.wmsDistaskH.carry_id).ExecuteCommandAsync();
WmsPurchaseD wmsPurchaseD = await _db.Queryable<WmsPurchaseD>().SingleAsync(x => x.id == input.wmsDistaskH.source_id);
await _db.Updateable<WmsCarryCode>().SetColumns(r => new WmsCarryCode
{
auxprop_gys = wmsPurchaseD.auxprop_gys,
auxprop_xph = wmsPurchaseD.auxprop_xph
}).Where(r => r.carry_id == input.wmsDistaskH.carry_id).ExecuteCommandAsync();
if (instock.sync_status != WmsWareHouseConst.SYNC_STATUS_NONEEDSYNC)
{
@@ -449,11 +452,18 @@ namespace Tnb.WarehouseMgr
// 委外入库
else if (instock.bill_type == WmsWareHouseConst.BILLTYPE_OUTSOURCEINSTOCK_ID)
{
}
// 调拨入库
else if (instock.bill_type == WmsWareHouseConst.BILLTYPE_RAWMATTRANSFERINSTOCK_ID)
{
WmsRawmatTransferinstockD wmsRawmatTransferinstockD = await _db.Queryable<WmsRawmatTransferinstockD>().SingleAsync(x => x.id == input.wmsDistaskH.source_id);
await _db.Updateable<WmsCarryCode>().SetColumns(r => new WmsCarryCode
{
auxprop_gys = wmsRawmatTransferinstockD.auxprop_gys,
auxprop_xph = wmsRawmatTransferinstockD.auxprop_xph
}).Where(r => r.carry_id == input.wmsDistaskH.carry_id).ExecuteCommandAsync();
// List<WmsInstockD> allInstockDetails = await _db.Queryable<WmsInstockD>().Where(it => it.bill_id == input.requireId).ToListAsync();
//
// WmsTempCode wmsTempCode = await _db.Queryable<WmsCarryCode>()
@@ -569,8 +579,10 @@ namespace Tnb.WarehouseMgr
await _db.Ado.CommitTranAsync();
}
catch (Exception)
catch (Exception ex)
{
Logger.LogWarning($"【WmsInStockService Modify】 {ex.Message}");
Logger.LogWarning($"【MaterialSign Modify】 {ex.StackTrace}");
await _db.Ado.RollbackTranAsync();
throw;
}

View File

@@ -410,7 +410,7 @@ namespace Tnb.WarehouseMgr
List<WmsMaterialTransferD> dList = await _db.Queryable<WmsMaterialTransferD>().Where(x => x.bill_id == wmsMaterialTransferd.bill_id).OrderBy(x => x.id).ToListAsync();
DictionaryDataEntity unitData = await _db.Queryable<DictionaryTypeEntity>()
.LeftJoin<DictionaryDataEntity>((x, y) => x.Id == y.DictionaryTypeId)
.Where((x, y) => x.EnCode == DictConst.MeasurementUnit && (y.EnCode == wmsMaterialTransferd.unit_id || y.Id == wmsMaterialTransferd.unit_id))
.Where((x, y) => x.EnCode == DictConst.MeasurementUnit && (y.EnCode == wmsMaterialTransferd.unit_id || y.Id== wmsMaterialTransferd.unit_id))
.Select((x, y) => y)
.FirstAsync();
string unitId = unitData?.Id ?? "";
@@ -457,6 +457,7 @@ namespace Tnb.WarehouseMgr
erpRequestData.Add("pk_org_v", erpOrg.pk_org_v);
erpRequestData.Add("vbillcode", wmsMaterialTransfer.bill_code);
erpRequestData.Add("vtrantypecode", "4I-01");//其他出库 先写死
erpRequestData.Add("csourcebillhid", wmsMaterialTransfer.erp_pk);//其他出库 先写死
List<Dictionary<string, object>> erpRequestDataDetails = new List<Dictionary<string, object>>();
erpRequestDataDetails.Add(new Dictionary<string, object>()
{

View File

@@ -1090,6 +1090,7 @@ namespace Tnb.WarehouseMgr
erpRequestData.Add("pk_org_v", erpOrg.pk_org_v);
erpRequestData.Add("vbillcode", wmsMaterialTransfer.bill_code);
erpRequestData.Add("vtrantypecode", "4I-01");//其他出库 先写死
erpRequestData.Add("csourcebillhid", wmsMaterialTransfer.erp_pk);
List<Dictionary<string, object>> erpRequestDataDetails = new List<Dictionary<string, object>>();
erpRequestDataDetails.Add(new Dictionary<string, object>()
{
@@ -1126,6 +1127,7 @@ namespace Tnb.WarehouseMgr
thirdWebapiRecord.url = WmsWareHouseConst.BIP_DOMAIN + "uapws/rest/generalout/save";
thirdWebapiRecord.request_data = JsonConvert.SerializeObject(requestData);
thirdWebapiRecord.create_time = DateTime.Now;
thirdWebapiRecord.remark = $"原材料转库单wms_material_transfer:{wmsMaterialTransfer.bill_code}";
await _db.Insertable(thirdWebapiRecord).ExecuteCommandAsync();
Logger.LogInformation("【WmsMaterialTransferService ModifyAsync】同步其它出库单到erp成功");

View File

@@ -177,6 +177,7 @@ namespace Tnb.WarehouseMgr
erpRequestData.Add("pk_group", erpOrg.pk_group);
erpRequestData.Add("vbillcode", instock.bill_code);
erpRequestData.Add("vtrantypecode", tranType?.EnCode ?? "");
erpRequestData.Add("csourcebillhid", wmsPurchaseH?.erp_arriveorder_pk ?? "");
List<Dictionary<string, object>> erpRequestDataDetails = new List<Dictionary<string, object>>();
foreach (WmsInstockD item in allInstockDetails)