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

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

@@ -50,6 +50,7 @@ namespace Tnb.BasicData
Dictionary<string, object> requestData = JsonConvert.DeserializeObject<List<Dictionary<string, object>>>(record.request_data)[0];
string reportId = requestData["report_id"].ToString();
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))
{
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<PrdReport>()
.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();
}