From f7899769244519db9967e3cdfc57d8ee48c31eb4 Mon Sep 17 00:00:00 2001
From: zyf <1071160500@qq.com>
Date: 星期二, 06 八月 2024 12:43:25 +0800
Subject: [PATCH] aaa
---
MES.Service/Dto/webApi/ErpCAB.cs | 4 +++-
MES.Service/service/WomcaaManager.cs | 14 +++++++++++++-
2 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/MES.Service/Dto/webApi/ErpCAB.cs b/MES.Service/Dto/webApi/ErpCAB.cs
index c052532..53a95a0 100644
--- a/MES.Service/Dto/webApi/ErpCAB.cs
+++ b/MES.Service/Dto/webApi/ErpCAB.cs
@@ -20,5 +20,7 @@
public string? FNumerator { get; set; }
public string? FDenominator { get; set; }
public string ID { get; set; }
- public string PID { get; set; }
+ public string? PID { get; set; }
+
+ public string? FSeq { get; set; }
}
\ No newline at end of file
diff --git a/MES.Service/service/WomcaaManager.cs b/MES.Service/service/WomcaaManager.cs
index 6b7e989..4203eb1 100644
--- a/MES.Service/service/WomcaaManager.cs
+++ b/MES.Service/service/WomcaaManager.cs
@@ -2,6 +2,8 @@
using MES.Service.Dto.webApi;
using MES.Service.Modes;
using SqlSugar;
+using System;
+using System.Security.Cryptography;
namespace MES.Service.service;
@@ -74,7 +76,8 @@
private Womcaa MapErpCAAtoWomcaa(ErpCAA dto)
{
- return new Womcaa
+
+ var entity = new Womcaa
{
Erpid = Convert.ToDecimal(dto.Id),
Caa001 = dto.FBillNo,
@@ -115,6 +118,11 @@
Caa019 = Convert.ToDecimal(dto.planSeq),
Caa020 = dto.planNum
};
+
+ var single = base.GetSingle(it => it.Erpid == entity.Erpid);
+ if (single != null) entity.Id = single.Id;
+
+ return entity;
}
private List<Womcab> MapErpCABtoWomcab(List<ErpCAB> dtoList)
@@ -127,6 +135,7 @@
{
Erpid = Convert.ToDecimal(dto.ID),
Cab001 = dto.FBillNo,
+ Cab002 = dto.FSeq,
Cab003 = dto.FMaterialID2,
Cab006 = !string.IsNullOrEmpty(dto.FNeedQty2)
? Convert.ToDecimal(dto.FNeedQty2)
@@ -152,6 +161,9 @@
Eid = Convert.ToDecimal(dto.PID)
};
+ var entity = Db.Queryable<Womcab>().Where(s => s.Erpid == womcab.Erpid).Single();
+ if (entity != null) womcab.Id = entity.Id;
+
womcabList.Add(womcab);
}
--
Gitblit v1.9.3