diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsOutsourceService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsOutsourceService.cs index 4157fed9..f99357a4 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsOutsourceService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsOutsourceService.cs @@ -344,7 +344,7 @@ namespace Tnb.WarehouseMgr erpRequestDataDetails.Add(new Dictionary() { - ["castunitid"] = erpExtendFields.Find(x => x.table_id == (unitDatas.Find(x => x.EnCode == item.unit_id || x.Id == item.unit_id)?.Id ?? ""))?.cunitid, + ["castunitid"] = erpExtendFields.Find(x => x.table_id == (unitDatas.Find(x => x.EnCode == item.unit || x.Id == item.unit)?.Id ?? ""))?.cunitid, ["cfirstbid"] = wmsOutsourceOrderH?.erp_pk, ["cfirstid"] = item.erp_outsource_order_d_pk, ["cfirsttypecode"] = null, @@ -353,7 +353,7 @@ namespace Tnb.WarehouseMgr ["csendcountryid"] = "0001Z010000000079UJJ", ["csourcetypecode"] = null, ["ctaxcountryid"] = "0001Z010000000079UJJ", - ["cunitid"] = erpExtendFields.Find(x => x.table_id == (unitDatas.Find(x => x.EnCode == item.unit_id || x.Id == item.unit_id)?.Id ?? ""))?.cunitid, + ["cunitid"] = erpExtendFields.Find(x => x.table_id == (unitDatas.Find(x => x.EnCode == item.unit || x.Id == item.unit)?.Id ?? ""))?.cunitid, ["dbilldate"] = wmsOutsourceH.create_time.ToString("yyyy-MM-dd HH:mm:ss"), ["dplanreceivedate"] = wmsOutsourceH.create_time.ToString("yyyy-MM-dd HH:mm:ss"), ["dproducedate"] = wmsOutsourceH.create_time.ToString("yyyy-MM-dd HH:mm:ss"), @@ -383,7 +383,7 @@ namespace Tnb.WarehouseMgr ["pk_receivestore"] = item.erp_wh_type, ["pk_reqstoorg"] = erpOrg.pk_org, ["pk_reqstoorg_v"] = erpOrg.pk_org_v, - ["pk_srcmaterial"] = erpExtendFields.Find(x => x.table_id == item.matcode_id)?.cmaterialoid, + ["pk_srcmaterial"] = basMaterial == null ? null : erpExtendFields.Find(x => x.table_id == basMaterial.id)?.cmaterialoid, ["vbatchcode"] = item.code_batch, ["Vfree1"] = item.code_batch, ["mes_detail_id"] = item.id, @@ -395,7 +395,7 @@ namespace Tnb.WarehouseMgr ["csourcetypecode"] = null, ["vsourcerowno"] = null, ["vsourcetrantype"] = null, - ["cproductorid"] = item.production_unit, + ["cproductorid"] = erpExtendFields.Find(x => x.table_id == (unitDatas.Find(x => x.EnCode == item.unit || x.Id == item.unit)?.Id ?? ""))?.cunitid, }); } erpRequestData.Add("dtls", erpRequestDataDetails); @@ -407,8 +407,8 @@ namespace Tnb.WarehouseMgr thirdWebapiRecord.third_name = WmsWareHouseConst.BIP; thirdWebapiRecord.name = "委外到货"; thirdWebapiRecord.method = "POST"; - // thirdWebapiRecord.url = config.value+"uapws/rest/purarrvial/save"; - thirdWebapiRecord.url = WmsWareHouseConst.BIP_DOMAIN + "uapws/rest/purarrvial/save"; + thirdWebapiRecord.url = config.value + "uapws/rest/purarrvial/save"; + //thirdWebapiRecord.url = WmsWareHouseConst.BIP_DOMAIN + "uapws/rest/purarrvial/save"; thirdWebapiRecord.request_data = JsonConvert.SerializeObject(erpRequestData); thirdWebapiRecord.create_time = DateTime.Now; thirdWebapiRecord.remark = $"【WmsOutsourceService Purchase】erp委外订单:{wmsOutsourceOrderH.erp_bill_code}";