mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-09-19 01:58:01 +08:00
fix: 入库单调整为sqlsugar后主从表关联处理
This commit is contained in:
@@ -2,13 +2,11 @@
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using OpenAuth.App.Interface;
|
||||
using OpenAuth.App.Request;
|
||||
using OpenAuth.App.Response;
|
||||
using OpenAuth.Repository;
|
||||
using OpenAuth.Repository.Domain;
|
||||
using OpenAuth.Repository.Interface;
|
||||
|
||||
using SqlSugar;
|
||||
|
||||
namespace OpenAuth.App
|
||||
@@ -55,6 +53,7 @@ namespace OpenAuth.App
|
||||
|
||||
public void Add(AddOrUpdateWmsInboundOrderDtblReq req)
|
||||
{
|
||||
SugarClient.Ado.BeginTran();
|
||||
AddNoSave(req);
|
||||
SugarClient.Ado.CommitTran();
|
||||
}
|
||||
@@ -65,9 +64,10 @@ namespace OpenAuth.App
|
||||
//todo:补充或调整自己需要的字段
|
||||
obj.CreateTime = DateTime.Now;
|
||||
var user = _auth.GetCurrentUser().User;
|
||||
obj.GenerateDefaultKeyVal();
|
||||
obj.CreateUserId = user.Id;
|
||||
obj.CreateUserName = user.Name;
|
||||
SugarClient.Insertable(obj);
|
||||
SugarClient.Insertable(obj).ExecuteCommand();
|
||||
}
|
||||
|
||||
public void Update(AddOrUpdateWmsInboundOrderDtblReq obj)
|
||||
|
@@ -2,13 +2,10 @@
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using OpenAuth.App.Interface;
|
||||
using OpenAuth.App.Request;
|
||||
using OpenAuth.App.Response;
|
||||
using OpenAuth.Repository;
|
||||
using OpenAuth.Repository.Domain;
|
||||
using OpenAuth.Repository.Interface;
|
||||
using SqlSugar;
|
||||
|
||||
|
||||
@@ -16,7 +13,6 @@ namespace OpenAuth.App
|
||||
{
|
||||
public class WmsInboundOrderTblApp : SqlSugarBaseApp<WmsInboundOrderTbl>
|
||||
{
|
||||
private RevelanceManagerApp _revelanceApp;
|
||||
private WmsInboundOrderDtblApp _wmsInboundOrderDtblApp;
|
||||
|
||||
/// <summary>
|
||||
@@ -69,7 +65,7 @@ namespace OpenAuth.App
|
||||
obj.CreateUserId = user.Id;
|
||||
obj.CreateUserName = user.Name;
|
||||
SugarClient.Ado.BeginTran();
|
||||
SugarClient.Insertable(obj);
|
||||
SugarClient.Insertable(obj).ExecuteCommand();
|
||||
if (req.WmsInboundOrderDtblReqs != null && req.WmsInboundOrderDtblReqs.Any())
|
||||
{
|
||||
foreach (var detail in req.WmsInboundOrderDtblReqs)
|
||||
@@ -103,7 +99,7 @@ namespace OpenAuth.App
|
||||
.Where(u => !string.IsNullOrEmpty(u)).ToList();
|
||||
if (containids.Any())
|
||||
{
|
||||
SugarClient.Deleteable<WmsInboundOrderDtbl>(u => (!containids.Contains(u.Id)) && u.OrderId == obj.Id);
|
||||
SugarClient.Deleteable<WmsInboundOrderDtbl>(u => (!containids.Contains(u.Id)) && u.OrderId == obj.Id).ExecuteCommand();
|
||||
}
|
||||
|
||||
//更新id相同的
|
||||
@@ -142,9 +138,8 @@ namespace OpenAuth.App
|
||||
}
|
||||
|
||||
public WmsInboundOrderTblApp(ISqlSugarClient client, IAuth auth,
|
||||
RevelanceManagerApp app, WmsInboundOrderDtblApp wmsInboundOrderDtblApp) : base(client, auth)
|
||||
WmsInboundOrderDtblApp wmsInboundOrderDtblApp) : base(client, auth)
|
||||
{
|
||||
_revelanceApp = app;
|
||||
_wmsInboundOrderDtblApp = wmsInboundOrderDtblApp;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user