产成品入库增加来源单据号 来源单据行标识

This commit is contained in:
2024-10-09 10:55:44 +08:00
parent dc5cce35ee
commit b3223e7966
4 changed files with 21 additions and 0 deletions

View File

@@ -5,5 +5,7 @@ namespace Tnb.BasicData.Entities.Dto
public string pk_wr { get; set; } public string pk_wr { get; set; }
public string pk_wr_product { get; set; } public string pk_wr_product { get; set; }
public string report_id { get; set; } public string report_id { get; set; }
public string vsourcebillcode { get; set; }
public string vsourcerowno { get; set; }
} }
} }

View File

@@ -50,6 +50,7 @@ namespace Tnb.BasicData
Dictionary<string, object> requestData = JsonConvert.DeserializeObject<List<Dictionary<string, object>>>(record.request_data)[0]; Dictionary<string, object> requestData = JsonConvert.DeserializeObject<List<Dictionary<string, object>>>(record.request_data)[0];
string reportId = requestData["report_id"].ToString(); string reportId = requestData["report_id"].ToString();
PrdReport report = await _repository.AsSugarClient().Queryable<PrdReport>().Where(x=>x.id==reportId).SingleAsync(); PrdReport report = await _repository.AsSugarClient().Queryable<PrdReport>().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)) if (report != null && !string.IsNullOrEmpty(report.erp_pk_wr) && !string.IsNullOrEmpty(report.erp_pk_wr_product))
{ {
requestData["csourcebillhid"] = report.erp_pk_wr; requestData["csourcebillhid"] = report.erp_pk_wr;
@@ -58,6 +59,8 @@ namespace Tnb.BasicData
{ {
item["csourcebillhid"] = report.erp_pk_wr; item["csourcebillhid"] = report.erp_pk_wr;
item["csourcebillbid"] = report.erp_pk_wr_product; item["csourcebillbid"] = report.erp_pk_wr_product;
item["vsourcebillcode"] = report.vsourcebillcode;
item["vsourcerowno"] = report.vsourcerowno;
} }
record.request_data = JsonConvert.SerializeObject(requestData); record.request_data = JsonConvert.SerializeObject(requestData);
@@ -277,12 +280,16 @@ namespace Tnb.BasicData
JObject data = (JObject)thirdResult.msg; JObject data = (JObject)thirdResult.msg;
JToken children = data.SelectToken("children")[0]; JToken children = data.SelectToken("children")[0];
JToken parent = data.SelectToken("parent");
string vbillcode = parent["valueIndex"]["vbillcode"].ToString();
var responsetDtos = children.Select(x => new ErpReportDto() var responsetDtos = children.Select(x => new ErpReportDto()
{ {
// pk_wr_product = x["valueIndex"]["pk_wr_product"].ToString(), // 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]["pk_wr_product_q"].ToString(),
pk_wr_product = x["qualityvos"][0]["valueIndex"]["pk_wr_quality"].ToString(), pk_wr_product = x["qualityvos"][0]["valueIndex"]["pk_wr_quality"].ToString(),
pk_wr = x["valueIndex"]["pk_wr"].ToString(), pk_wr = x["valueIndex"]["pk_wr"].ToString(),
vsourcerowno = x["valueIndex"]["vbrowno"].ToString(),
vsourcebillcode = vbillcode,
report_id = reportId report_id = reportId
}).ToList(); }).ToList();
@@ -294,6 +301,8 @@ namespace Tnb.BasicData
updateRow += await db.Updateable<PrdReport>() updateRow += await db.Updateable<PrdReport>()
.SetColumns(x => x.erp_pk_wr == item.pk_wr) .SetColumns(x => x.erp_pk_wr == item.pk_wr)
.SetColumns(x => x.erp_pk_wr_product == item.pk_wr_product) .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) .Where(x => x.id == item.report_id)
.ExecuteCommandAsync(); .ExecuteCommandAsync();
} }

View File

@@ -168,6 +168,14 @@ public partial class PrdReport : BaseEntity<string>
/// 生产报告表体主键 /// 生产报告表体主键
/// </summary> /// </summary>
public string erp_pk_wr_product { get; set; } public string erp_pk_wr_product { get; set; }
/// <summary>
/// erp来源单据号
/// </summary>
public string vsourcebillcode { get; set; }
/// <summary>
/// erp来源单据行标识
/// </summary>
public string vsourcerowno { get; set; }
/// <summary> /// <summary>
/// 合格数 /// 合格数

View File

@@ -459,6 +459,8 @@ namespace Tnb.WarehouseMgr
["pk_org_v"] = erpOrg.pk_org_v, ["pk_org_v"] = erpOrg.pk_org_v,
["vbatchcode"] = item.code_batch, ["vbatchcode"] = item.code_batch,
["vproductbatch"] = prdMo.mo_code.Split("-")[0], ["vproductbatch"] = prdMo.mo_code.Split("-")[0],
["vsourcebillcode"] = prdReport.vsourcebillcode,
["vsourcerowno"] = prdReport.vsourcerowno,
}); });
} }
erpRequestData.Add("dtls", erpRequestDataDetails); erpRequestData.Add("dtls", erpRequestDataDetails);