From 5707781039b9d902ce1d2d6727fba65bbab14574 Mon Sep 17 00:00:00 2001 From: 啊鑫 <t2856754968@163.com> Date: 星期六, 13 九月 2025 17:02:06 +0800 Subject: [PATCH] 异常单回滚 --- WebApi/Gs.BaseInfo/Services/MesCustomerManager.cs | 49 +++++++++++++++++++++---------------------------- 1 files changed, 21 insertions(+), 28 deletions(-) diff --git a/WebApi/Gs.BaseInfo/Services/MesCustomerManager.cs b/WebApi/Gs.BaseInfo/Services/MesCustomerManager.cs index a00ab71..abf6633 100644 --- a/WebApi/Gs.BaseInfo/Services/MesCustomerManager.cs +++ b/WebApi/Gs.BaseInfo/Services/MesCustomerManager.cs @@ -12,14 +12,13 @@ namespace Gs.BaseInfo.Services; /// <summary> -/// 瀹㈡埛绠$悊 +/// 瀹㈡埛绠$悊 /// </summary> [ApiGroup(ApiGroupNames.BaseInfo)] public class MesCustomerManager : Repository<MesCustomer>, IRomteService { private readonly IHttpContextAccessor _http; private readonly string _userCode, _userGuid, _orgFids; - public MesCustomerManager(IHttpContextAccessor httpContextAccessor) { _http = httpContextAccessor; @@ -43,32 +42,26 @@ new StringBuilder(query.sortName + " " + query.sortOrder); var totalCount = 0; var itemsList = Db - .Queryable<MesCustomer, SysOrganization>((a, org) => - new object[] - { - JoinType.Left, a.FSubsidiary == org.Fid - }).Select((a, org) => new MesCustomer - { - FSubsidiary = "(" + org.FNumber + ")" + org.Name, - Fforbidstatus = a.Fforbidstatus + ":" + - (a.Fforbidstatus == "A" ? "姝e父" : "绂佺敤"), - DataType = a.DataType + ":" - + SqlFunc.IF(a.DataType == "Z") - .Return("鏆傚瓨") - .ElseIF(a.DataType == "A") - .Return("鍒涘缓") - .ElseIF(a.DataType == "B") - .Return("瀹℃牳涓�") - .ElseIF(a.DataType == "C") - .Return("宸插鏍�") - .ElseIF(a.DataType == "D") - .Return("閲嶆柊瀹℃牳") - .End(a.DataType) - }, true) - .Where(_sbWhere.ToString()) - .OrderBy(_sbBy.ToString()) - .ToPageList(query.currentPage, query.everyPageSize, - ref totalCount); + .Queryable<MesCustomer, SysOrganization>( + (a, org) => new object[] + { + JoinType.Left, a.FSubsidiary == org.Fid, + }).Select((a, org) => new MesCustomer + { + FSubsidiary = "(" + org.FNumber + ")" + org.Name, + Fforbidstatus = a.Fforbidstatus + ":" + (a.Fforbidstatus == "A" ? "姝e父" : "绂佺敤"), + DataType = a.DataType + ":" + + SqlFunc.IF(a.DataType == "Z").Return("鏆傚瓨") + .ElseIF(a.DataType == "A").Return("鍒涘缓") + .ElseIF(a.DataType == "B").Return("瀹℃牳涓�") + .ElseIF(a.DataType == "C").Return("宸插鏍�") + .ElseIF(a.DataType == "D").Return("閲嶆柊瀹℃牳") + .End(a.DataType) + }, true) + .Where(_sbWhere.ToString()) + .OrderBy(_sbBy.ToString()) + .ToPageList(query.currentPage, query.everyPageSize, + ref totalCount); pageList = new PageList<MesCustomer>(itemsList, totalCount, query.everyPageSize); return ReturnDto<PageList<MesCustomer>>.QuickReturn(pageList, -- Gitblit v1.9.3