diff --git a/BasicData/Tnb.BasicData.Entities/Dto/ErpReportDto.cs b/BasicData/Tnb.BasicData.Entities/Dto/ErpReportDto.cs index 0ec18610..8a99b4bb 100644 --- a/BasicData/Tnb.BasicData.Entities/Dto/ErpReportDto.cs +++ b/BasicData/Tnb.BasicData.Entities/Dto/ErpReportDto.cs @@ -5,5 +5,7 @@ namespace Tnb.BasicData.Entities.Dto public string pk_wr { get; set; } public string pk_wr_product { get; set; } public string report_id { get; set; } + public string vsourcebillcode { get; set; } + public string vsourcerowno { get; set; } } } \ No newline at end of file diff --git a/BasicData/Tnb.BasicData/ThirdApiRecordService.cs b/BasicData/Tnb.BasicData/ThirdApiRecordService.cs index 4b9517d1..13cdaf94 100644 --- a/BasicData/Tnb.BasicData/ThirdApiRecordService.cs +++ b/BasicData/Tnb.BasicData/ThirdApiRecordService.cs @@ -50,6 +50,7 @@ namespace Tnb.BasicData Dictionary requestData = JsonConvert.DeserializeObject>>(record.request_data)[0]; string reportId = requestData["report_id"].ToString(); PrdReport report = await _repository.AsSugarClient().Queryable().Where(x=>x.id==reportId).SingleAsync(); + // if (report != null && !string.IsNullOrEmpty(report.erp_pk_wr) && !string.IsNullOrEmpty(report.erp_pk_wr_product) && !string.IsNullOrEmpty(report.vsourcebillcode) && !string.IsNullOrEmpty(report.vsourcerowno)) if (report != null && !string.IsNullOrEmpty(report.erp_pk_wr) && !string.IsNullOrEmpty(report.erp_pk_wr_product)) { requestData["csourcebillhid"] = report.erp_pk_wr; @@ -58,6 +59,8 @@ namespace Tnb.BasicData { item["csourcebillhid"] = report.erp_pk_wr; item["csourcebillbid"] = report.erp_pk_wr_product; + item["vsourcebillcode"] = report.vsourcebillcode; + item["vsourcerowno"] = report.vsourcerowno; } record.request_data = JsonConvert.SerializeObject(requestData); @@ -277,12 +280,16 @@ namespace Tnb.BasicData JObject data = (JObject)thirdResult.msg; JToken children = data.SelectToken("children")[0]; + JToken parent = data.SelectToken("parent"); + string vbillcode = parent["valueIndex"]["vbillcode"].ToString(); var responsetDtos = children.Select(x => new ErpReportDto() { // pk_wr_product = x["valueIndex"]["pk_wr_product"].ToString(), // pk_wr_product = x["qualityvos"][0]["pk_wr_product_q"].ToString(), pk_wr_product = x["qualityvos"][0]["valueIndex"]["pk_wr_quality"].ToString(), pk_wr = x["valueIndex"]["pk_wr"].ToString(), + vsourcerowno = x["valueIndex"]["vbrowno"].ToString(), + vsourcebillcode = vbillcode, report_id = reportId }).ToList(); @@ -294,6 +301,8 @@ namespace Tnb.BasicData updateRow += await db.Updateable() .SetColumns(x => x.erp_pk_wr == item.pk_wr) .SetColumns(x => x.erp_pk_wr_product == item.pk_wr_product) + .SetColumns(x=>x.vsourcebillcode==item.vsourcebillcode) + .SetColumns(x=>x.vsourcerowno==item.vsourcerowno) .Where(x => x.id == item.report_id) .ExecuteCommandAsync(); } diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdReport.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdReport.cs index 65c8c09f..689c7493 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdReport.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdReport.cs @@ -168,6 +168,14 @@ public partial class PrdReport : BaseEntity /// 生产报告表体主键 /// public string erp_pk_wr_product { get; set; } + /// + /// erp来源单据号 + /// + public string vsourcebillcode { get; set; } + /// + /// erp来源单据行标识 + /// + public string vsourcerowno { get; set; } /// /// 合格数 diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPrdInstockHService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPrdInstockHService.cs index 1fe93137..62cecd9f 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPrdInstockHService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPrdInstockHService.cs @@ -459,6 +459,8 @@ namespace Tnb.WarehouseMgr ["pk_org_v"] = erpOrg.pk_org_v, ["vbatchcode"] = item.code_batch, ["vproductbatch"] = prdMo.mo_code.Split("-")[0], + ["vsourcebillcode"] = prdReport.vsourcebillcode, + ["vsourcerowno"] = prdReport.vsourcerowno, }); } erpRequestData.Add("dtls", erpRequestDataDetails);